<?php

if (! defined ( 'IN_KEKE' )) {
	exit ( 'Access Denied' );
}



$task_obj = new Keke_witkey_hire_class();

$task_status_arr = keke_glob_class::get_hire_status();

$sql = "SELECT count(hire_id)as c ,hire_status FROM `".TABLEPRE."witkey_hire` where uid = $uid  group by hire_status;";
$count_arr = db_factory::query($sql);
foreach ($count_arr as $k=>$v) {
	$temp_arr[$v['hire_status']] = $v['c'];
}
$count_arr = $temp_arr;

$where = ' uid =' . $uid ;

$task_obj->setWhere($where);
$count_all = $task_obj->count_keke_witkey_hire();

if (isset ( $task_status ) && $task_status != "all") {
	$where .= ' and  hire_status =' . intval ( $task_status );
}
$page_size = intval ( $page_size ) ? intval ( $page_size ) : 17;

$task_obj->setWhere ( $where );
$count = $task_obj->count_keke_witkey_hire();
$page = $page ? intval($page): 1;
$url = 'index.php?do=' . $do . '&model_id=' . $model_id . '&view=' . $view . '&task_status='.$task_status.'&page='.$page;

$limit = $page_size;
$pages = $page_obj->getPages ( $count, $limit, $page, $url );

$order_where = ' order by dateline desc ';

$where .= $order_where;

$task_obj->setWhere ( $where . $pages [where] );
$task_arr = $task_obj->query_keke_witkey_hire();
 

require_once keke_tpl_class::template ( 'task/' . $model_info ['model_dir'] . '/tpl/' . $_K ['template'] . "/user_release_task" );
